'use strict';

import css from './css/index.css';
import less from './css/black.less';
import scss from './css/aa.scss';
import "babel-polyfill";
// import $ from 'jquery';

//兼容ie8浏览器，测试没有通过
// import "./es5-shim/4.5.13/es5-shim"
// import "./es5-shim/4.5.13/es5-sham";
var json = require('../config.json');
var config = require('./config.js').default;
var search = require('./search').default;
var sleepTool = require('./sleepTool').default;

console.log("1");
// document.getElementById('title').innerHTML='Hello Webpack哈哈';

const currentPage = location.pathname;
if (currentPage === "/index.html") {
    let hzhSrting = 'Hello Webpack!偶哟这';
    document.getElementById('title').innerHTML = hzhSrting;
    $("#title").html("偶像22哦");
    let stu = require("./Student");
    document.getElementById("json").innerHTML = json.name + ":sex:" + json.sex;
    document.getElementById("config").innerHTML = config.app.passengerName + ":" + config.app.ageType;
    showMsg(stu.sayHi("汪老师"));
    $(async function () {
        showMsg("准备ok了");
        let startTm = new Date().getTime();
        let time = 3000;
        let result = await sleepTool.sleep2(time);
        let endTm = new Date().getTime();
        // debugger;
        console.log("最终结果:" + result + ",耗时:" + (endTm - startTm));
        const msg1 = `${time / 1000}秒后睡醒了`;
        showMsg(msg1);
    });
    function showMsg(msg) {
        $("#msg").append(msg + "<br/>");
    }
} else if (currentPage == "/search.html") {
    search.showMsg("我草");
}